home *** CD-ROM | disk | FTP | other *** search
- ***********************************************************************
- *
- * busybox umenu.asm -- Version 3.0
- *
- * Copyright (c)
- * Apple Computer, Inc. 1986-1990
- * All Rights Reserved.
- *
- * Developer Technical Support Apple II Sample Code
- *
- * This file contains the code which implements menus in the
- * busybox program.
- *
- ***********************************************************************
-
- case on
-
- copy 2/ainclude/e16.types
- copy 2/ainclude/e16.event
- copy busybox.equ
-
- mcopy macros/umenu.macros
-
- longi on
- longa on
-
- doQuitItem start
-
- inc quitFlag ;That's all folks.
- rts
-
- end
-
- ***********************************************************************
-
- doAboutItem start
-
- pha ;Pop up the resource Alert.
- pea 4
- pea 0|-16
- pea 0
- pea 1|-16
- pea 1
- _AlertWindow
- pla
- rts
-
- end
-
- ***********************************************************************
- * Procedure to handle all menu selections. Examines the event.TaskData
- * menu item ID word from TaskMaster (from Event Manager) and calls the
- * appropriate routine. While the routine is running the menu title is
- * still highlighted. After the routine returns, we unhilight the
- * menu title.
-
- doMenu start
-
- lda event+owmTaskData ;Item number
- cmp #AboutItem
- bne aa
- jsr doAboutItem
- jmp zz
-
- aa cmp #CloseItem
- bne bb
- jsr doCloseTop
- jmp zz
-
- bb cmp #QuitItem
- bne zz
- jsr doQuitItem
-
- zz pea 0
- lda event+owmTaskData+2 ;menuNum
- pha
- _HiliteMenu
- rts
-
- end
-
- ***********************************************************************
-
- setupMenus start
-
- pha ;Get menus from resource
- pha
- pea refIsResource
- pea $1000|-16
- pea $1000
- pea 0|-16
- pea 0
- _NewMenuBar2
- _SetSysBar
-
- pea 0|-16
- pea 0
- _SetMenuBar
-
- pea AppleMenuID
- _FixAppleMenu
-
- pha
- _FixMenuBar
- pla
-
- _DrawMenuBar
- rts
-
- end
-
- END
-